// (statue) healer.txt v1.0
// M. G. Slack - 2007
// (slack at attglobal dot net)
// Simple script, kicks off a potential healing routine when searched.  Requires payment
// for healing (unless family found).
//
// Memory Cells -
//  <none>

beginterrainscript; 

variables;

short choice, i, n;

body;

beginstate INIT_STATE;
break;

beginstate START_STATE;
break;

beginstate SEARCH_STATE;
	// healing statue
	reset_dialog();
	add_dialog_str(0, "The statue seems to glow with an inner energy.", 0);
	add_dialog_str(1, "Do you search it?", 0);
	add_dialog_choice(0, "Yes");
	add_dialog_choice(1, "No");
	choice = run_dialog(1);
	if (choice == 1) {
		reset_dialog();
		add_dialog_str(0, "As you run your hands over the warm stone, crackles of static electricity envelope you.", 0);
		i = coins_amount();
		if (get_flag(50, 1) > 0) { i = 1; }
		if (i > 0) {
			add_dialog_str(1, "You feel refreshed and healed.", 0);
			if (get_flag(50, 1) == 0) {
				n = 50 * party_size();
				add_dialog_str(2, "You also feel your purse get a little less heavy.", 0);
				if (i > n) { i = n; }
				if (pay_coins(i) == TRUE) { }
			}
		}
		else {
			add_dialog_str(1, "Nothing else seems to happen though.", 0);
		}
		add_dialog_choice(0, "Ok");
		choice = run_dialog(1);
		// heal them if they paid...
		if (i > 0) {
			i = 0;
			while (i < 4) {
				if (char_status(i) > 0) {
					restore_pc(i);
				}
				i = i + 1;
			}
		}
	}
break;
